<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>方法</title>
</head>
<body>
<div id="aa">
    {{num}}<br/>
    <button v-on:click="add()">加</button>
</div>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
    let app = new Vue({
        el: "#aa",
        data: {
            num: 0
        },
        methods: {
            add: function () {
                this.num++;
            }
        }

    })
</script>


</body>
</html>